import java.awt.event.ActionEvent; //导入包
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
class winJFrame  extends JFrame{
    JLabel lab1=new JLabel("Java GUI图形程序设计"); //标签1，括号里面的是信息
    JTextArea txt1=new JTextArea(); //文本框txt1
    JScrollPane p1=new JScrollPane(txt1); //面板p1，并把文本框放入
    JButton b1=new JButton("按  钮");
    public  winJFrame()
    {
        setLayout(null);//setLayout(new GridLayout(2,5));
        setTitle("Java语言程序设计");
        setBounds(320, 100, 800,450);
        lab1.setBounds(10,20, 200,20);
        add(lab1);
        p1.setBounds(10,50, 760,300);
        add(p1);
        b1.setBounds(470,370, 80,20);
        add(b1);
        b1.addActionListener(new ActionListener(){
                                 public void actionPerformed(ActionEvent e){
                                     JOptionPane.showMessageDialog(null, "经济学学院");
                                 }
                             }
        );
    }
}
public class javaTest {
    public static void main(String[] args) {
        winJFrame win=new winJFrame();
        win.setVisible(true);
    }
}